import Dao.StudentDao;
import com.alibaba.druid.pool.DruidDataSource;
import com.ynny.students;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudentsTest {
    @Test
    public void test() {
        DruidDataSource druidDataSource = new DruidDataSource();
        druidDataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
        druidDataSource.setUrl("jdbc:mysql://localhost:3306/user");
        druidDataSource.setUsername("root");
        druidDataSource.setPassword("123456");
        System.out.println(druidDataSource);
    }

    @Test
    public void test2() {

        ClassPathXmlApplicationContext applicationContext =
                new ClassPathXmlApplicationContext(
                        "Student.xml");

        StudentDao studentDao = applicationContext.getBean("studentDao", StudentDao.class);

        int i = studentDao.update(new students());

    }
}